package com.heima.article.controller.v1;

import com.heima.article.service.ApArticleService;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author 刘旭
 * @Date 2022/8/31 16:00
 * @Description:
 */
@RestController
@RequestMapping("api/v1/article")
public class ApArticleController {
    /**
     * 把自媒体文章数据，保存到文章表中
     *
     * @param dto
     * @return
     */
    @Autowired
    ApArticleService apArticleService;

    @PostMapping("/save")
    public ResponseResult saveAricle(@RequestBody ArticleDto dto) {

        return apArticleService.saveAricle(dto);
    }
}